package cn.doitedu.cn.doitedu.rtdw.ddl;

import org.apache.flink.table.api.bridge.java.StreamTableEnvironment;
import org.apache.flink.table.catalog.hive.HiveCatalog;

public class CatalogDatabaseSwitch {

    public static void switchCatalogDatabase(String catalogName, String dataBaseName, StreamTableEnvironment tenv){
        HiveCatalog hiveCatalog = new HiveCatalog(catalogName, null, "rtdw/src/main/resources/");
        tenv.registerCatalog(catalogName, hiveCatalog);
        tenv.useCatalog(catalogName);
        tenv.useDatabase(dataBaseName);
    }

}
